Show:

ia.Theme Class

Extends ia.BaseData
Defined in: ia\data\Theme.js:1
Module: ia

Contains information about a ia.Theme.

Constructor

ia.Theme

(
  • geography
  • theme
  • data
)

Defined in ia\data\Theme.js:1

Parameters:

  • geography ia.Geography

    The geography the theme belongs to.

  • theme ia.Theme

    The parent theme the theme belongs to or undefined if its a child of the geography.

  • data JSON

    The json data describing the object.

Methods

getChildren

() Object

Inherited from ia.BaseData but overwritten in ia\data\Theme.js:119

Returns an array of data objects that are children of this object.

Returns:

Object: An array of data objects.

getComparisonData

(
  • indicatorId
)
Object

Gets the themes indicator comparison data.

Parameters:

  • indicatorId String

    The indicator id.

Returns:

Object: An array of data objects.

getComparisonDataForDate

(
  • date
)
Object

Gets the themes indicators with the given date.

Parameters:

  • date String

    The date.

Returns:

Object: An array of data objects.

getData

(
  • indicatorId
  • featureIds
)
Object

Gets the themes indicator data.

Parameters:

  • indicatorId String

    An optional indicator id.

  • featureIds String

    An optional list of feature ids to get data for.

Returns:

Object: An array of data objects.

getDataForDate

(
  • date
  • featureIds
)
Object

Gets the themes indicator data with the given date.

Parameters:

  • date String

    The date.

  • featureIds String

    An optional list of feature ids to get data for.

Returns:

Object: An array of data objects.

getDataTree

(
  • showDates
  • reverseDates
  • dataHash
  • parentId
)

Returns an associative array of the form:

["i1"]{id:"i1"; label:"Home"; type:"branch"; children:["i2"; "i3"; "i4"]}
["i2"]{id:"i2"; label:"ia.Indicator 1"; type:"branch"; parent:"i1"; children:["i5"; "i6"; "i7"]}
["i5"]{id:"i5~2004"; label:"2004"; type:"leaf"; parent:"i2"}

Used by data explorers. Dates are returned as part of the tree.

Parameters:

  • showDates Boolean

    Should the dates be displayed.

  • reverseDates Boolean

    Should the dates be reversed.

  • dataHash Associative Array

    An associative array as described.

  • parentId String

    The parent id.

getFeatureData

(
  • feature
  • date
)
JSON

A hashtable of the indicators/associates for a feature - used by feature card.

Parameters:

  • feature Object

    A feature object.

  • date String

    An optional date.

Returns:

JSON: As described above.

getFirstIndicator

(
  • reverseDates
)
ia.Indicator

Returns the first indicator - this can be within a nested ia.Theme. Where dates are used the first indicator is the one with the most recent date

Parameters:

  • reverseDates Boolean

    Should the dates be reversed.

Returns:

ia.Indicator: The indicator.

getIndicator

(
  • id
  • date
  • reverseDates
)
ia.Indicator

Returns the indicator that corresponds to the id and date provided. Will include the latest date of an indicator if the specified date is unavailable.

Parameters:

  • id String

    The indicator id.

  • date String

    An optional date.

  • reverseDates Boolean

    Should the dates be reversed.

Returns:

ia.Indicator: The indicator.

getIndicatorDates

(
  • indicatorId
)
String

Returns a list of dates for the indicator that matches the id provided.

Parameters:

  • indicatorId String

    The indicator id.

Returns:

String: A list of dates.

getIndicatorIds

() String

Returns a list of indicator ids contained in the theme.

Returns:

String: A list of indicator ids.

getIndicatorNames

() String

Returns a list of indicator names contained in the theme.

Returns:

String: A list of indicator names.

getIndicators

(
  • date
)
ia.Indicator[]

Returns the indicators with the given date. Will include the latest date of an indicator if the specified date is unavailable.

Parameters:

  • date String

    The date.

Returns:

ia.Indicator[]: An array of indicators.

getIndicators

(
  • indicatorId
)
ia.Indicator[]

Returns the indicators contained in the theme or with the given id if that is supplied.

Parameters:

  • indicatorId String

    An optional indicator id.

Returns:

ia.Indicator[]: An array of indicators.

getNestedIndicator

(
  • id
  • date
  • reverseDates
)
ia.Indicator

Includes indicators in nested themes.

Parameters:

  • id String

    The indicator id.

  • date String

    An optional date.

  • reverseDates Boolean

    Should the dates be reversed.

Returns:

ia.Indicator: The indicator.

getParentThemes

() ia.Theme[]

Returns a list of the parent theme names including this one.

Returns:

ia.Theme[]: An array of parent theme names.

getProfileData

(
  • featureIds
  • themeArray
  • date
  • useLatestDate
)

A hashtable of the indicators/associates for a feature - used for profiles.

The returned data has the following structure:

["t0"]{id:"t0", name:"theme0", type:"parent"}
["i0"]{id:"i0", name:"indicator0", value:2345, value_formatted:2345, associate1:25, associate1_formatted:25, type:"leaf"}
["i1"]{id:"i1", name:"indicator1", value:4347, value_formatted:4347, associate1:45, associate1_formatted:45, type:"leaf"}
["i2"]{id:"i2", name:"indicator1", value:2496, value_formatted:2496, associate1:25, associate1_formatted:25, type:"leaf"}

Parameters:

  • featureIds String

    A list of feature ids to get data for.

  • themeArray Object

    The array to add the theme objects to.

  • date String

    An optional date.

  • useLatestDate Boolean

    Use the latest date if the specified date is unavailable?

getProperties

() Associative Array

Returns the custom properties. An associative array of the form: [propName] = propValue.

Returns:

Associative Array: The properties.

getProperty

(
  • propName
)
Number | String

Returns a value for a custom property.

Parameters:

  • propName String

    The name of the property.

Returns:

Number | String: The value of the property, or undefined if it doesnt exist.

getThemes

() ia.Theme[]

Defined in ia\data\Theme.js:92

Returns the themes contained in the ia.Theme.

Returns:

ia.Theme[]: An array of themes.

loadData

(
  • callbackFnc
)

Loads all data in the theme.

Parameters:

  • callbackFnc Function

    The callbackFnc gets called with the loaded object as the parameter.

loadIndicator

(
  • id
  • date
  • callbackFnc
)

Loads the indicator that corresponds to the id and date provided. The indicator can be in a nested ia.Theme. Returns the indicator via the supplied callback function.

Parameters:

  • id String

    The indicator id.

  • date String

    An optional date.

  • callbackFnc Function

    The callbackFnc gets called with the loaded object as the parameter.

parseData

(
  • data
)

Defined in ia\data\Theme.js:32

Parses the JSON data.

Parameters:

  • data JSON

    The json data describing the object.

Properties

customColumns

Object} Array of columns.

The custom columns that can be used in the data table.

data

JSON

The raw json data describing the object.

fileName

String

The file name.

geography

ia.Geography

The parent geography.

hasData

Boolean

Indicates if this object contains data.

Default: true

hasThemes

Boolean

Defined in ia\data\Theme.js:23

Indicates if this theme contains nested themes.

Default: false

href

String

The href.

id

String

The id.

name

String

The name.

parent

Object

The parent object.

precision

Number

The precision. Inherited from parent if undefined.

type

Number

The data type. Inherited from parent if undefined.

Default: "categoric"